<?php

namespace App\Models\OpenShop\InvestmentPromotion;

use App\Models\BaseModel;
use App\Models\Traits\KfUid;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Relations\HasOne;

class OpenShopContractTemplateModel extends BaseModel
{
    use KfUid;

    protected $table = 'open_shop_contract_template';

    const ONLINE_DATA_TIME_V1 = '2023-12-10 12:00:00';

    const MODE_1 = 1;
    const MODE_2 = 2;
    const MODE_3 = 3;

    const MODE_MAP_TEXT = [
        self::MODE_1 => '传统模式',
        self::MODE_2 => '分账模式',
        self::MODE_3 => '定金模式',
    ];

    const IS_SHOW_0 = 0;
    const IS_SHOW_1 = 1;
    const IS_SHOW_2 = 2;
    const IS_SHOW_3 = 3;

    const IS_SHOW_TEXT = [
        self::IS_SHOW_0 => "已停用",
        self::IS_SHOW_1 => "已启用",
        self::IS_SHOW_2 => "未启用",
        self::IS_SHOW_3 => "已关闭",
    ];


    public function templateRel(): HasOne
    {
        return $this->hasOne(OpenShopContractTemplateModel::class, 'policyTemplateId');
    }


}
